import 'package:flutter/material.dart';
import 'PointerEventTestRoute.dart';
import 'GestureDetectorTestRoute.dart';
import 'NotificationRoute.dart';

class EventHandlingAndNotificationTestRoute extends StatefulWidget {
  @override
  State<StatefulWidget> createState() =>
      new _EventHandlingAndNotificationTestRouteState();
}

class _EventHandlingAndNotificationTestRouteState
    extends State<EventHandlingAndNotificationTestRoute> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('事件通知与处理'),
      ),
      body: new Center(
        child: Wrap(
          spacing: 8.0,
          alignment: WrapAlignment.center,
          children: <Widget>[
            RaisedButton(
              color: Colors.blue,
              highlightColor: Colors.blue[700],
              colorBrightness: Brightness.dark,
              splashColor: Colors.grey,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(20.0),
              ),
              child: Text('原始指针事件PointerEvent'),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) {
                      return new PointerEventTestRoute();
                    },
                  ),
                );
              },
            ),
            RaisedButton(
              color: Colors.blue,
              highlightColor: Colors.blue[700],
              colorBrightness: Brightness.dark,
              splashColor: Colors.grey,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(20.0),
              ),
              child: Text('手势识别GestureDetector'),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) {
                      return new GestureDetectorTestRoute();
                    },
                  ),
                );
              },
            ),
            RaisedButton(
              color: Colors.blue,
              highlightColor: Colors.blue[700],
              colorBrightness: Brightness.dark,
              splashColor: Colors.grey,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(20.0),
              ),
              child: Text('全局事件总线'),
              onPressed: () {

              },
            ),
            RaisedButton(
              color: Colors.blue,
              highlightColor: Colors.blue[700],
              colorBrightness: Brightness.dark,
              splashColor: Colors.grey,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(20.0),
              ),
              child: Text('通知Notification'),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) {
                      return new NotificationRoute();
                    },
                  ),
                );
              },
            ),
          ],
        ),
      ),
    );
  }
}
